#include <iostream>

#include "request.hpp"
#include "response.hpp"
#include "apollo_client.hpp"

using namespace apollo;

int main(void)
{
    Request request;
    request.setAppId("SampleApp");
    //request.setNamespace("daq.txt");
    // request.setNamespace("TEST1.daq");
	 request.setNamespace("application");
    // request.setNamespace("daq.ihep.txt");
    request.setServerUrl("centos201:8080");
    request.setClusterName("default");

    ApolloClient client;
    Response res = client.getConfigFromServer(request, ApolloClient::configSuffix::PROPERTIES);
    //Response res = client.getProperties(request);
    std::cout << res.getAppId() << std::endl;
    std::cout << res.getCluster() << std::endl;
    std::cout << res.getNamespace() << std::endl;
    std::cout << res.getReleaseKey() << std::endl;
    std::cout << res.getConfiguration() << "\n";

    return 0;
}
